function SoftPhone() {
    // 坐席登录编号
    this.loginId = '';
    // 坐席姓名
    this.agentName = '';
    // 坐席CTI工号
    this.agentId = '';
    // 坐席CTI工号登录密码
    this.ctiPass = '';
    // 坐席CTI工号签入分机号
    this.extNo = '';
    // 坐席对应操作员工号-交易上送使用
    this.opeNo = '';
    // 坐席所属租户
    this.tenantId = '';
    // 坐席所属租户职场
    this.workPlace = '';
    // 坐席所拥有的技能组
    // this.agentgroupList = [];
    this.agentGroup = '';
    // 默认外呼技能组
    this.outboundGroup = '';
    // 软电话应用URL
    this.ivr_path = '';
    // IVR转接URL
    this.ivrServerPath = '';
    // CTI服务签入链接
    this.ctiConnectors = [];
    // 坐席状态更新URL配置
    this.dealConnectors = '';
    // 坐席监控数据查询地址
    this.httpConnector = '';
    // 坐席监控地址
    this.monitorConnector = '';
    // 外呼示忙原因码
    this.outboundReasonCode = '';
    // 挂机示忙原因码
    this.dropCallReason = '';
    // 示忙原因码-展示在下拉框
    this.notReadyReasons = [];
    // 示忙原因名称-展示在下拉框
    this.notReadyReasonNames = [];
    // 辅助示忙原因码-不展示在下拉框
    this.hiddByteReasons = [];
    // 辅助示忙原因码-不展示在下拉框
    this.hiddByteReasonNames = [];
    // 当前坐席未就绪原因码
    this.currentbusyReason = '';
    // 当前坐席状态
    this.currAgentStatus = '';
    // 保存会话信息
    this.sessionData = '';
    // ucid获取sessionId
    this.ucidMap = {};
    // 当前会话ID
    this.currentSessionId = '';
    // 当前呼叫ucid
    this.currentUcid = '';
    // 当前呼叫ID
    this.currentContactId = '';
    // 外呼生成sessionId变量因子
    this.outboundInd = 0;
    // 转接IVR流程VDN
    this.ivrVdnNo = '';
    // 定时器
    this.timerInterval = null;
    this.cxtime = 0;
    this.uui = '';//呼叫唯一标识
    this.isAothAnwser = '';
    this.msyFlag = ''; //是否转满意度标识;
    this.aicPath = '';
    this.aicPort = '';
    this.toIvrFlag = '';
    this.sessionType = 'n';
    this.first = false;
    this.direction = '';//呼叫方向 in 呼入 out 呼出
    this.zhIvrVdnNo = '';
    this.queueNo = '';
    this.isUpdate = '';


    //链接本地AIC插件
    this.start = function () {
        var wsImpl = window.WebSocket || window.MozWebSocket;
        window.ws = new wsImpl('ws://127.0.0.1:8181/');
        //服务器返回消息处理
        addEventListener(ws);

        ws.onopen = function () {
            console.info(".. connection open");
            // 签入 签出按钮
            $('#loginOrLogoutBtn').attr('disabled', false);
        };

        ws.onclose = function () {
            console.info(".. connection closed");
            $('#loginOrLogoutBtn').disabled = true;
        }
    }
    //   /** 初始化对象值* */
    this.initObj = function (loginId, agentName, agentId, ctiPass, extNo, opeNo, tenantId, workPlace, agentGroup, outboundGroup, ivr_path, ivrServerPath, ctiConnectors, dealConnectors, httpConnector, monitorConnector, outboundReasonCode, dropCallReason, notReadyReasons, notReadyReasonNames, hiddByteReasons, hiddByteReasonNames, ivrVdnNo, toIVRType, aothAnwserFlag, aicPath, aicPort, zhIvrVdnNo, queueNo) {
        this.loginId = loginId;
        this.agentName = agentName;
        this.agentId = agentId;
        this.ctiPass = ctiPass;
        this.extNo = extNo;
        this.opeNo = opeNo;
        this.tenantId = tenantId;
        this.workPlace = workPlace;
        // this.agentgroupList = agentgroupList;
        this.agentGroup = agentGroup;
        this.outboundGroup = outboundGroup;
        this.ivr_path = ivr_path;
        this.ivrServerPath = ivrServerPath;
        this.ctiConnectors = ctiConnectors;
        this.dealConnectors = dealConnectors;
        this.httpConnector = httpConnector;
        this.monitorConnector = monitorConnector;
        this.outboundReasonCode = outboundReasonCode;
        this.dropCallReason = dropCallReason;
        this.notReadyReasons = notReadyReasons;
        this.notReadyReasonNames = notReadyReasonNames;
        this.hiddByteReasons = hiddByteReasons;
        this.hiddByteReasonNames = hiddByteReasonNames;
        this.ivrVdnNo = ivrVdnNo;
        this.aothAnwserFlag = aothAnwserFlag;
        this.aicPath = aicPath;
        this.aicPort = aicPort;
        this.zhIvrVdnNo = zhIvrVdnNo;
        this.queueNo = queueNo;
        //初始化软电话
        this.start();
    };

    this.isAothAnwser = function () {
        console.log("是否自动应答：" + this.aothAnwserFlag);
        if (this.aothAnwserFlag === '1') {
            return true;
        } else {
            return false;
        }
    }

    /***
     * 计算请求参数长度
     */
    this.getParamsLength = function (num, length) {

        return (Array(length).join('0') + num).slice(-length);

    }
    /***
     * 生成请求参数
     */
    this.getRequestData = function (params, num) {
        var paramsLength = params.length;
        var headStr = 'AVAYA1' + this.getParamsLength(paramsLength, 8) + this.getParamsLength('1', 8) + '          ' + params;
        var reqStr = headStr;
        return reqStr;
    }
    /**
       * 清除session
       */
    this.clearSession = function (sessionId) {
        // if (typeof this.sessionMap[sessionId] !== 'undefined' && this.sessionMap[sessionId] !== null) {
        //     const { ucid } = this.sessionMap[sessionId];
        //     const { contactId } = this.sessionMap[sessionId];
        //     delete this.sessionMap[sessionId];
        //     delete this.ucidMap[ucid];
        //     delete this.ucidMap[contactId];
        // }
        // console.log('检查清楚缓存的时间是什么时候——————————120');
        this.sessionData = '';
        this.msyFlag = '';
        this.direction = '';
        this.toIvrFlag = '';
        if (sessionId==='1') {
            this.sessionType = 'n';
        }
        this.uui = '';
    };

    /**
       * 清除所有session
       */
    this.clearAllSession = function () {
        // for (const pId in this.sessionMap) {
        //     const { sessionId } = this.sessionMap[pId];
        //     const { ucid } = this.sessionMap[pId];
        //     const { contactId } = this.sessionMap[pId];
        //     delete this.sessionMap[sessionId];
        //     delete this.ucidMap[ucid];
        //     delete this.ucidMap[contactId];
        // }
        // console.log('检查清楚缓存的时间是什么时候——————————110');
        this.sessionData = '';
        this.msyFlag = '';
        this.direction = '';
        this.toIvrFlag = '';

        this.uui = '';
    };
    this.isCalling = function () {
        // if (this.currAgentStatus === '通话中') {
        //     return true;
        // }
        // return false;
        return true;
    };

    /**
       * 签入
       */
    this.connectBtnClick = function () {
        // var paramStr = this.getRequestData('{"request":"InitializeAICWS","params":{"icServerAIp":"38.63.169.76","icServerAPort":"9700","icServerBIp":"","icServerBPort":"0","logPath":"C:/1rongshu/avaya/logs"}}');
        var paramStr = this.getRequestData('{"request":"InitializeAICWS","params":{"icServerAIp":"' + this.aicPath + '","icServerAPort":"' + this.aicPort + '","icServerBIp":"","icServerBPort":"0","logPath":"C:/1rongshu/avaya/logs"}}');
        console.info('paramStr:' + paramStr);
        ws.send(paramStr);
        var sendParam = this.getRequestData('{"request":"AgentLogin","params":{"agentId":"' + this.agentId + '","terminalId":"' + this.extNo + '","password":"' + this.ctiPass + '"}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 签出确认
       */
    this.isDisconnectBtnClick = function () {
        this.showErrorInfo('提示', '是否确认签出？', 'Logout');
        // var sendParam = this.getRequestData('{"request":"AgentLogoff"}');
        // console.info('paramStr:' + sendParam);
        // ws.send(sendParam);
    };

    /**
     * 签出
     */
    this.disconnectBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"AgentLogoff"}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 判断当前签入或签出 状态 走不同 方法
       */
    this.connectOrCheckOutBtnClick = function () {
        if (this.loginOrLogoutBtnLabel() === '签入') {
            this.connectBtnClick();
        } else {
            // this.disconnectBtnClick();
            this.isDisconnectBtnClick();
        }
    };

    /**
       * 应答（接起）
       */
    this.answerBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"CallAnswer"}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 挂断电话
       */
    this.hangupBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"CallRelease"}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 示闲（就绪）
       */
    this.IdleBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"AgentAvailable"}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 示忙（未就绪）
       */
    this.busyBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"AgentLux","params":{"auxCode":"0"}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };
    /**
         * 示闲或示忙
         */
    this.idleOrbusyBtnClick = function () {
        if (this.idleOrbusyBtnLabel() === '就绪') {
            this.IdleBtnClick();
        } else {
            this.busyBtnClick();
        }
    };

    /**
       * 外拨
       */
    this.dialBtnClick = function (number) {
        var sendParam = this.getRequestData('{"request":"MakeCall","params":{"destNo":"' + number + '","userData":""}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /***
     * 保持
     * @constructor
     */
    this.callHold = function () {
        var sendParam = this.getRequestData('{"request":"CallHold"}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    }

    /***
     * 恢复
     * @constructor
     */
    this.callRetrieve = function () {
        var sendParam = this.getRequestData('{"request":"CallRetrieve"}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    }

    /**
       * 电话保持
       */
    this.holdOrRetrieveBtnClick = function () {
        if (this.holdBtnLabel() === '保持') {
            // var sendParam = this.getRequestData('{"request":"CallHold"}');
            // console.info('paramStr:' + sendParam);
            // ws.send(sendParam);
            this.callHold();
        } else {
            // var sendParam = this.getRequestData('{"request":"CallRetrieve"}');
            // console.info('paramStr:' + sendParam);
            // ws.send(sendParam);
            this.callRetrieve();
        }
    };

    /**
       * 转接IVR
       * menuId 转接具体流程配置
       */
    this.tranferIVRBtnClick = function (menuId, AUTH) {
        if (this.isCalling()) {

            var data = { "uui": this.uui };
            var sendParam = this.getRequestData('{"request":"CallTransfer","params":{"destNo":"' + this.ivrVdnNo + '","userData":' + JSON.stringify(data) + '}}');
            // var sendParam = this.getRequestData('{"request":"CallTransfer","params":{"destNo":"'+this.ivrVdnNo+'","userData":{"uui":"'+this.uui+'"}}}');
            console.info('paramStr:' + sendParam);
            var map = new Map();
            map.set('MENUID', menuId);
            map.set('TRNDRI', '1');//传递方向( 1位)——0－IVR转Agent、1－Agent转IVR、2－IVR转回Agent
            map.set('TRANTYPE', '0');//转接类型【0-单转   1-会议】
            map.set('IDTYPE', window.sessionCustData.keyType);
            map.set('IDNO', window.sessionCustData.custCertNo);
            map.set('CARD', window.sessionCustData.cradNo);
            map.set('AGENTID', this.extNo);
            map.set('AUTH', AUTH);
            this.setUserDatas(this.uui, map);
            ws.send(sendParam);
        } else {
            this.showErrorInfo('提示', '非通话中，不能转接IVR！', 'warning');
        }
    };

    /**
     * 转接综合IVR
     * menuId 转接具体流程配置
     */
    this.tranferZHIVRClick = function () {
        if (this.isCalling()) {
            var data = { "uui": this.uui };
            var sendParam = this.getRequestData('{"request":"CallTransfer","params":{"destNo":"' + this.zhIvrVdnNo + '","userData":' + JSON.stringify(data) + '}}');
            console.info('paramStr:' + sendParam);
            ws.send(sendParam);
        } else {
            this.showErrorInfo('提示', '非通话中，不能转接IVR！', 'warning');
        }
    };

    /**
     * 转接坐席队列
     * menuId 转接具体流程配置
     */
    this.tranferAgentQueueClick = function () {
        if (this.isCalling()) {
            var data = { "uui": this.uui };
            var sendParam = this.getRequestData('{"request":"CallTransfer","params":{"destNo":"' + this.queueNo + '","userData":' + JSON.stringify(data) + '}}');
            console.info('paramStr:' + sendParam);
            var map = new Map();
            map.set('AUTH', this.sessionData.ivrData.data.AUTH);
            map.set('PEGTD', this.sessionData.ivrData.data.PEGTD);
            map.set('IDNO', window.sessionCustData.custCertNo);
            map.set('CARD', window.sessionCustData.cradNo);
            this.setUserDatas(this.uui, map);
            ws.send(sendParam);
        } else {
            this.showErrorInfo('提示', '非通话中，不能转接IVR！', 'warning');
        }
    };


    /**
       * 会议转接IVR
       * menuId 转接具体流程配置
       */
    this.conferencetranferIVRBtnClick = function (menuId) {
        if (this.isCalling()) {
            if (window.sessionCustData.custCertNo === '' || window.sessionCustData.custCertNo === '') {
                this.showErrorInfo('提示', '证件号或者卡号为空，不能转接IVR！', 'warning');
            } else {
                var data = { "uui": this.uui };
                // var sendParam = this.getRequestData('{"request":"CallConferenceIVR","params":{"ivrId":"'+this.ivrVdnNo+'","userData":'+JSON.stringify(data)+'}}');
                var sendParam = this.getRequestData('{"request":"CallCollConferenceBegin","params":{"destNo":"' + this.ivrVdnNo + '","userData":' + JSON.stringify(data) + '}}');
                // var sendParam = this.getRequestData('{"request":"CallCollTransferBegin","params":{"destNo":"'+this.ivrVdnNo+'","userData":'+JSON.stringify(data)+'}}');
                console.info('paramStr:' + sendParam);
                var map = new Map();
                map.set('MENUID', menuId);
                map.set('TRNDRI', '1');//传递方向( 1位)——0－IVR转Agent、1－Agent转IVR、2－IVR转回Agent
                map.set('TRANTYPE', '1');//转接类型【0-单转   1-会议】
                map.set('IDNO', window.sessionCustData.custCertNo);
                map.set('CARD', window.sessionCustData.cradNo);
                map.set('AGENTID', this.extNo);
                this.setUserDatas(this.uui, map);
                ws.send(sendParam);
            }
        } else {
            this.showErrorInfo('提示', '非通话中，不能转接IVR！', 'warning');
        }
    };

    /**
       * 转接坐席
       * agentId: 坐席CTI工号
       */
    this.tranferAgentBtnClick = function (agentId, data) {
        var sendParam = this.getRequestData('{"request":"CallTransfer","params":{"destNo":"' + agentId + '","userData":' + JSON.stringify(data) + '}}');
        var map = new Map();
        map.set('AUTH', this.sessionData.ivrData.data.AUTH);
        map.set('PEGTD', this.sessionData.ivrData.data.PEGTD);
        map.set('IDNO', window.sessionCustData.custCertNo);
        map.set('CARD', window.sessionCustData.cradNo);
        this.setUserDatas(this.uui, map);
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
     * 咨询坐席
     */
    this.completeAgentBtnClick = function (agentId, data) {
        var sendParam = this.getRequestData('{"request":"CallCollTransferBegin","params":{"destNo":"' + agentId + '","userData":' + JSON.stringify(data) + '}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
     * 取回咨询
     *
     */
    this.completeCancelBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"CallCollCancel","params":null}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 坐席会议
       * agentId: 邀请加入会议的坐席CTI工号
       */
    this.conferenceAgentBtnClick = function (agentId, data) {
        var sendParam = this.getRequestData('{"request":"CallCollConferenceBegin","params":{"destNo":"' + agentId + '","userData":' + JSON.stringify(data) + '}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };
    /**
     * 完成会议
     */
    this.conferenceAgentOkBtnClick = function () {
        var sendParam = this.getRequestData('{"request":"CallCollComplete","params":null}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    };

    /**
       * 转接技能组
       * skillNoVdn: 要转接的技能组VDN
       */
    this.tranferSkillNoBtnClick = function (skillNoVdn) {
        skillTransfer(skillNoVdn);
    };

    /**
       * 转接外线
       * telNo: 要转接的外线号码
       */
    this.transferTelNoBtnClick = function (telNo) {
        transferTelNo(telNo);
    };

    /**
       * 转接满意度
       *
       */
    this.satisfactionTransferBtnClick = function () {
        var data = {
            "uui": '0000000000'
        };
        this.tranferBtnClick('888888', data);
    };

    /**
       * 获取签入签出按钮标签
       *
       */
    this.loginOrLogoutBtnLabel = function () {
        return getLoginOrLogoutBtnLabel();
    };

    /**
       * 获取示闲示忙按钮标签
       *
       */
    this.idleOrbusyBtnLabel = function () {
        return getIdleOrbusyBtnLabel();
    };

    /**
       * 签入签出按钮状态更新
       * flag: true-签入，fale-签出
       */
    this.loginOrLogoutBtnStatusUpdate = function (flag) {
        setLoginOrLogoutBtnLabel(flag);
    };

    /**
     * 就绪示忙按钮状态更新
     * flag: true-就绪，fale-示忙
     */
    this.idleOrbusyBtnStatusUpdate = function (flag) {
        setIdleOrbusyBtnStatus(flag);
    };
    /**
     * 更新保持按钮标签
     * title 标签名称
     */
    this.idleOrbusyBtnLabelUpdate = function (title) {
        setidleOrbusyBtnLabel(title);
    };

    /**
       * 外呼号码输入框赋值
       * value 外呼号码
       */
    this.dialNumberVal = function (value) {
        setDialNumberVal(value);
    };

    /**
       * 外呼号码输入框状态更新
       * flag: true-可用，fale-不可用
       */
    this.dialNumberStatusUpdate = function (flag) {
        setDialNumberStatus(flag);
    };

    /**
       * 外呼按钮状态更新
       * flag: true-可用，fale-不可用
       */
    this.outBoundBtnStatusUpdate = function (flag) {
        setOutBoundBtnStatus(flag);
    };

    /**
       * 接听按钮状态更新
       * flag: true-可用，fale-不可用
       */
    this.answerBtnStatusUpdate = function (flag) {
        setAnswerBtnStatus(flag);
    };

    /**
       * 挂断按钮状态更新
       * flag: true-可用，fale-不可用
       */
    this.hangupBtnStatusUpdate = function (flag) {
        setHangupBtnStatus(flag);
    };

    /**
       * 获取保持按钮标签
       *
       */
    this.holdBtnLabel = function () {
        return getHoldBtnLabel();
    };

    /**
       * 更新保持按钮标签
       * title 标签名称
       */
    this.holdBtnLabelUpdate = function (title) {
        setHoldBtnLabel(title);
    };
    /**
     * 咨询取回按钮状态更新
     * ttitle 标签名称
     */
    this.setConsultBtnLabelUpdate = function (title) {
        setConsultBtnLabel(title);
    };

    /**
     * 会议完成按钮状态更新
     * title 标签名称
     */
    this.setConferenceBtnLabelUpdate = function (title) {
        setConferenceBtnLabel(title);
    };

    /**
       * 更新保持状态更新
       * flag: true-可用，fale-不可用
       */
    this.holdBtnStatusUpdate = function (flag) {
        setHoldBtnStatus(flag);
    };

    /**
       * 坐席状态标签更新
       * title 标签名称
       */
    this.agentStatusTimeLabelUpdate = function (msg, time) {
        setAgentStatusTimeLabel(msg, time);
    };

    /**
     * 挂断按钮状态更新
     * flag: true-可用，fale-不可用
     */
    this.hangupBtnStatusUpdate = function (flag) {
        setHangupBtnStatus(flag);
    };
    /**
     * 转坐席按钮状态更新
     * flag: true-可用，fale-不可用
     */
    this.toAgentBtnStatusUpdate = function (flag) {
        setToAgentBtnStatus(flag);
    };
    /**
     * 咨询按钮状态更新
     * flag: true-可用，fale-不可用
     */
    this.toConsultBtnStatusUpdate = function (flag) {
        setToConsultBtnStatus(flag);
    };
    /**
     * 会议按钮状态更新
     * flag: true-可用，fale-不可用
     */
    this.conferenceAgentStatusUpdate = function (flag) {
        setConferenceAgentBtnStatus(flag);
    };
    /**
     * 满意度按钮状态更新
     * flag: true-可用，fale-不可用
     */
    this.satisfactionBtnStatusUpdate = function (flag) {
        setSatisfactionBtnStatus(flag);
    };

    /**
     * 验密按钮状态更新c
     * flag: true-可用，fale-不可用
     */
    this.checkPwdStatusUpdate = function (flag) {
        setCheckPwdBtnStatus(flag);
    };

    /**
     * 签入签出按钮状态更新
     * flag: true-可用，fale-不可用
     */
    this.setLogonOrOutBtnStatusUpdate = function (flag) {
        setLogonOrOutBtnStatus(flag);
    };

    /**
       * 挂机后其他操作
       *
       */
    this.callDropAfter = function (evt) {
        // 挂机后更新操作，例如弹出话后小结等
        callSummary();
    };

    this.formateTime = function (value) {
        let hour = 0; let minute = 0; let
            second = 0;
        hour = Math.floor(value / 3600);
        minute = Math.floor(value / 60 % 60);
        second = Math.floor(value % 60);
        if (hour < 10) {
            hour = `0${hour}`;
        }
        if (minute < 10) {
            minute = `0${minute}`;
        }
        if (second < 10) {
            second = `0${second}`;
        }
        return result = `${hour}:${minute}:${second}`;
    };

    /**
       * 坐席状态标签更新计时
       * msg 状态描述名称
       */
    this.agentStatusTimeUpdate = function (msg) {
        if (this.timerInterval !== null) // 如果已存在计数器，则先停止
        {
            window.clearInterval(this.timerInterval);
        }
        this.cxtime = (new Date()).getTime(); // 初始化状态开始时间
        function updateStatusTime() {
            const labelStr = top.softphone.formateTime(((new Date()).getTime() - top.softphone.cxtime) / 1000);
            top.softphone.agentStatusTimeLabelUpdate(msg, labelStr);
        }
        this.timerInterval = setInterval(updateStatusTime, 1000);
    };


    /**
       * 振铃弹屏-打开一个新会话
       * jsonData: 会话数据
       */
    this.openNewSession = function (jsonData) {
        top.softphone.currentSessionId = jsonData.sessionId;
        this.showErrorInfo('振铃弹屏', jsonData.sessionId, 'success');
    };


    /***
     * 设置单个随路数据
     * @param key
     */
    this.setUserData = function (callId, key, value) {
        var url = `${top.softphone.ivr_path}/WIEInfo/CTI/SetData/` + callId + '/' + key + '/' + value;
        $.ajax({
            type: 'GET',
            url: url,
            contentType: 'application/json',
            data: '',
            dataType: 'JSON',
            async: false,
            success(result) {
                if (result.code === 'OK') {
                    console.info(`${top.DateUtil.now()}: 设置单个随路数据成功` + result.success);
                } else {
                    console.info(`${top.DateUtil.now()}: code=${result.code}[${result.message}]`);
                }
            },
            error(errData) {
                console.info(`${top.DateUtil.now()}: 设置单个随路数据异常[${JSON.stringify(errData)}]`);
            },
        });
    }
    /***
     * 设置多个个随路数据
     * @param key
     */
    this.setUserDatas = function (callId, map) {
        var values = '';
        for (var [key, value] of map) {
            // if(value){
            values += 'data=' + key + ':' + value + '&';
            // }
        }
        values = values.substr(0, values.length - 1);
        var url = `${top.softphone.ivr_path}/WIEInfo/CTI/SetDatas/` + callId + '?' + values;
        console.info("url===" + url);
        $.ajax({
            type: 'GET',
            url: url,
            contentType: 'application/json',
            data: '',
            dataType: 'JSON',
            async: false,
            success(result) {
                if (result.code === 'OK') {
                    console.info(`${top.DateUtil.now()}: 设置多个随路数据成功` + result.success);
                } else {
                    console.info(`${top.DateUtil.now()}: code=${result.code}[${result.message}]`);
                }
            },
            error(errData) {
                console.info(`${top.DateUtil.now()}: 设置多个随路数据异常[${JSON.stringify(errData)}]`);
            },
        });
    }
    /***
     * 获取随路数据
     * @param key
     */
    this.getUserData = function (callId, key) {
        var url = `${top.softphone.ivr_path}/WIEInfo/CTI/GetData/` + callId + '/' + key;
        console.info("获取随录数据url：", url);
        var value = '';
        $.ajax({
            type: 'GET',
            url: url,
            contentType: 'application/json',
            data: '',
            dataType: 'JSON',
            async: false,
            success(result) {
                if (result.code === 'OK') {
                    value = result.data;
                    console.info(`${top.DateUtil.now()}: 获取随路数据成功:` + result.success + ",随路数据为：", value);
                } else {
                    console.info(`${top.DateUtil.now()}: code=${result.code}[${result.message}]`);
                }
            },
            error(errData) {
                console.info(`${top.DateUtil.now()}: 获取随路数据异常[${JSON.stringify(errData)}]`);
            },
        });
        return value;
    }

    /***
     * 获取随路数据
     * @param key
     */
    this.getUserAllData = function (callId) {
        var url = `${top.softphone.ivr_path}/WIEInfo/CTI/GetAllData/` + callId;
        console.info("获取随录数据url：", url);
        var value = '';
        $.ajax({
            type: 'GET',
            url: url,
            contentType: 'application/json',
            data: '',
            dataType: 'JSON',
            async: false,
            success(result) {
                if (result.code === 'OK') {
                    value = result;
                    console.info(`${top.DateUtil.now()}: 获取随路数据成功:` + result.success + ",随路数据为：", value);
                } else {
                    console.info(`${top.DateUtil.now()}: code=${result.code}[${result.message}]`);
                }
            },
            error(errData) {
                console.info(`${top.DateUtil.now()}: 获取随路数据异常[${JSON.stringify(errData)}]`);
            },
        });
        return value;
    }

    /***
     * 设置平台随路数据
     * @param callId
     * @param key
     * @param values
     */
    this.setUserDataAvaya = function (key, value) {
        var sendParam = this.getRequestData('{"request":"SetUserData","params":{"userDataKey":"' + key + '","userDataValue":"' + value + '"}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    }
    /***
     * 获取平台随路数据
     * @param callId
     * @param key
     * @param values
     */
    this.getUserDataAvaya = function (key) {
        var sendParam = this.getRequestData('{"request":"GetUserData","params":{"userDataKey":"' + key + '"}}');
        console.info('paramStr:' + sendParam);
        ws.send(sendParam);
    }

    this.saveSessionData = function (type, data) {
        if (type === 'in') {
            this.sessionData = data;
            this.uui = data.userData.uui;
            let ivrData = this.getUserAllData(data.userData.uui);
            console.info("ivrData::::::", ivrData);
            this.sessionData.ivrData = ivrData;
            this.sessionData.ani = ivrData.data.ANIS;
            // this.sessionData.ivrData.data.PEGTD = '';
            // this.sessionData.ivrData.data.AUTH = '';
            this.sessionData.ivrData.data.PEGTD = '';
            window.getSessionObject(data.userData.uui, this.sessionData);
        } else {
            let dataTmp = {
                ivrData: {
                    data: {
                        AUTH: '',
                        PEGTD: '',
                    }
                },
                uniqueId: '',
                ani: '',
                dnis: '',
            };
            this.sessionData = dataTmp;
            this.sessionData.ivrData.data.AUTH = '';
            this.sessionData.ivrData.data.PEGTD = '';
            this.sessionData.uniqueId = data.uniqueId;
            this.sessionData.ani = data.ani;
            this.sessionData.dnis = data.dnis;
            this.uui = data.uniqueId;
            window.getSessionObject(data.uniqueId, this.sessionData);
        }

    }

    /**
       * 根据坐席状态更新按钮
       */
    this.agentStateChangeBtnUpdate = function (agentStateChange, data) {
        console.info(agentStateChange);
        if (agentStateChange === 'Login') // 登录
        {
            this.agentStatusTimeUpdate('签入');
            this.loginOrLogoutBtnStatusUpdate(true);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(true);
            this.outBoundBtnStatusUpdate(true);
            this.idleOrbusyBtnStatusUpdate(true);
            this.idleOrbusyBtnLabelUpdate('就绪');
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
        }
        if (agentStateChange === 'Logout') // 签出
        {
            if (this.timerInterval !== null) // 如果已存在计数器，停止
            {
                window.clearInterval(this.timerInterval);
            }
            this.agentStatusTimeLabelUpdate('', '');
            this.loginOrLogoutBtnStatusUpdate(false);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(true);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
            this.toAgentBtnStatusUpdate(false);
            this.toConsultBtnStatusUpdate(false);
            this.conferenceAgentStatusUpdate(false);
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
        }
        if (agentStateChange === 'Ready') // 就绪
        {
            this.agentStatusTimeUpdate('空闲');
            this.loginOrLogoutBtnStatusUpdate(true);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(true);
            this.outBoundBtnStatusUpdate(true);
            this.idleOrbusyBtnStatusUpdate(true);
            this.idleOrbusyBtnLabelUpdate('示忙');
        }
        if (agentStateChange === 'NotReady') // 未就绪
        {
            this.agentStatusTimeUpdate('未就绪');
            this.loginOrLogoutBtnStatusUpdate(true);
            this.idleOrbusyBtnStatusUpdate(true);
            this.idleOrbusyBtnLabelUpdate('就绪');
            // this.dialNumberStatusUpdate(true);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
        }
        if (agentStateChange === 'WorkNotReady') // 挂机处理
        {
            this.agentStatusTimeUpdate('未就绪');
            this.loginOrLogoutBtnStatusUpdate(true);
            this.setLogonOrOutBtnStatusUpdate(true);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(true);
            this.idleOrbusyBtnLabelUpdate('就绪');
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(true);
            this.toAgentBtnStatusUpdate(false);
            this.toConsultBtnStatusUpdate(false);
            this.setConsultBtnLabelUpdate('咨询');
            this.conferenceAgentStatusUpdate(false);
            this.setConferenceBtnLabelUpdate('会议');
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
        }
        if (agentStateChange === 'MakeCall') // 外呼
        {
            this.agentStatusTimeUpdate('外呼振铃');
            this.loginOrLogoutBtnStatusUpdate(true);
            // this.dialNumberStatusUpdate(true);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(true);
            this.outBoundBtnStatusUpdate(false);
            this.setLogonOrOutBtnStatusUpdate(false);
        }
        if (agentStateChange === 'CallIncomming') // 来电振铃
        {
            this.agentStatusTimeUpdate('来电振铃');
            this.loginOrLogoutBtnStatusUpdate(true);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(true);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.setLogonOrOutBtnStatusUpdate(false);
        }
        if (agentStateChange === 'CallEstablished') // 通话处理
        {
            this.agentStatusTimeUpdate('通话中');
            this.loginOrLogoutBtnStatusUpdate(true);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(true);
            this.toAgentBtnStatusUpdate(true);
            this.toConsultBtnStatusUpdate(true);
            this.conferenceAgentStatusUpdate(true);
            this.satisfactionBtnStatusUpdate(true);
            // if (this.sessionType !== 'n') {
            //     this.checkPwdStatusUpdate(false);
            // } else {
            //     this.checkPwdStatusUpdate(true);
            // }
            this.checkPwdStatusUpdate(true);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(true);
            this.setLogonOrOutBtnStatusUpdate(false);
        }
        if (agentStateChange === 'CallHeld') // 保持
        {
            this.agentStatusTimeUpdate('保持');
            this.loginOrLogoutBtnStatusUpdate(false);
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false)
            this.holdBtnLabelUpdate('恢复');
            this.holdBtnStatusUpdate(true);;
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.toAgentBtnStatusUpdate(false);
            this.toConsultBtnStatusUpdate(false);
            this.conferenceAgentStatusUpdate(false);
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
        }
        if (agentStateChange === 'Retrieve') // 恢复通话
        {
            this.agentStatusTimeUpdate('通话中');
            this.loginOrLogoutBtnStatusUpdate(true);
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(true);
            this.outBoundBtnStatusUpdate(false);
            this.toAgentBtnStatusUpdate(true);
            this.toConsultBtnStatusUpdate(true);
            this.conferenceAgentStatusUpdate(true);
            this.satisfactionBtnStatusUpdate(true);
            // if (this.sessionType !== 'n') {
            //     this.checkPwdStatusUpdate(false);
            // } else {
            //     this.checkPwdStatusUpdate(true);
            // }
            this.checkPwdStatusUpdate(true);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(true);
            this.setLogonOrOutBtnStatusUpdate(false);
            this.setConsultBtnLabelUpdate('咨询');
            this.setConferenceBtnLabelUpdate('会议');
        }
        if (agentStateChange === 'CollTransferBegin') // 等待咨询接起
        {
            this.agentStatusTimeUpdate('等待咨询接起');
            this.loginOrLogoutBtnStatusUpdate(false);
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.toAgentBtnStatusUpdate(false);
            this.conferenceAgentStatusUpdate(false);
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
            this.setConsultBtnLabelUpdate('取回');
            this.toConsultBtnStatusUpdate(true);
            this.setLogonOrOutBtnStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
        }
        if (agentStateChange === 'ConferenceBegin') //发起会议
        {
            this.agentStatusTimeUpdate('发起会议');
            this.loginOrLogoutBtnStatusUpdate(false);
            this.setLogonOrOutBtnStatusUpdate(false);
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.toAgentBtnStatusUpdate(false);
            this.conferenceAgentStatusUpdate(false);
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
            this.setConsultBtnLabelUpdate('取回');
            this.toConsultBtnStatusUpdate(true);
            this.conferenceAgentStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
        }
        if (agentStateChange === 'DestConnected') //咨询
        {
            this.agentStatusTimeUpdate('咨询');
            this.loginOrLogoutBtnStatusUpdate(false);
            this.setLogonOrOutBtnStatusUpdate(false);
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.toAgentBtnStatusUpdate(false);
            this.conferenceAgentStatusUpdate(false);
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
            this.setConsultBtnLabelUpdate('取回');
            this.toConsultBtnStatusUpdate(true);
            this.setConferenceBtnLabelUpdate('完成');
            this.conferenceAgentStatusUpdate(true);
        }
        if (agentStateChange === 'checkPwd') //  转接IVR处理
        {
            this.agentStatusTimeUpdate('转IVR中');
            this.loginOrLogoutBtnStatusUpdate(false);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(false);
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(true);
            this.toAgentBtnStatusUpdate(false);
            this.toConsultBtnStatusUpdate(false);
            this.conferenceAgentStatusUpdate(false);
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
            this.setLogonOrOutBtnStatusUpdate(false);
        }
        if (agentStateChange === 'CallAfterCall') // 事后处理
        {
            this.agentStatusTimeUpdate('事后处理');
            this.loginOrLogoutBtnStatusUpdate(true);
            this.setLogonOrOutBtnStatusUpdate(true);
            // this.dialNumberVal('');
            // this.dialNumberStatusUpdate(false);
            this.outBoundBtnStatusUpdate(false);
            this.idleOrbusyBtnStatusUpdate(true);
            this.idleOrbusyBtnLabelUpdate('就绪');
            this.answerBtnStatusUpdate(false);
            this.hangupBtnStatusUpdate(false);
            this.outBoundBtnStatusUpdate(true);
            this.toAgentBtnStatusUpdate(false);
            this.toConsultBtnStatusUpdate(false);
            this.setConsultBtnLabelUpdate('咨询');
            this.conferenceAgentStatusUpdate(false);
            this.setConferenceBtnLabelUpdate('会议');
            this.satisfactionBtnStatusUpdate(false);
            this.checkPwdStatusUpdate(false);
            this.holdBtnLabelUpdate('保持');
            this.holdBtnStatusUpdate(false);
        }
    };

    /**
       * 错误提示信息
       */
    this.showErrorInfo = function (title, text, vPosition) {
        window.getElementMessage(title, text, vPosition);
    };

    /**
       * 插入通话历史
       */
    this.insertCallHistory = function (direction, data) {
        this.direction = direction;
        //this.sessionType = 'n';
        console.log('this.sessionType',this.sessionType);
        var ucid = '';
        var operatetraject = '';
        if (direction === 'in') {
            ucid = data.properties.userData.uui;
            operatetraject = this.sessionData.ivrData.data.OPERATETRAJECT;
            operatetraject = operatetraject.join("->");
        } else {
            ucid = data.properties.uniqueId;
        }

        try {
            this.sessionType = data.properties.userData.comment.sessionType;
            console.log('检查是否进入try',data);
        } catch (e) {
            // this.sessionType = 't';
            console.log('catch', this.sessionType);
        }
        console.log('this.sessionType2', this.sessionType);
        if(this.direction === 'in'){
            if (data.properties.userData.comment) {
                this.sessionType = 'd';
            }
        }

        // console.log('this.sessionType3', this.sessionType);
        var param = {
            "acctNo": "",
            "acdEndTime": "",
            "acdLong": "",
            "acdStartTime": "",
            "acwLong": "",
            "agentName": this.agentName,
            "ani": data.properties.ani,
            "callgroup": this.agentGroup,
            "channelType": "ivr",
            "contactid": data.properties.uniqueId,
            "ctiNo": this.agentId,
            "custHometel": "",
            "custName": "",
            "custNo": "",
            "custPhone": "",
            "custRes": "",
            "direction": direction,
            "dnis": data.properties.dnis,
            "endAcwTime": "",
            "enname": "",
            "extno": this.extNo,
            "id": "1",
            "ivrOperationTrajectory": "",
            "ivrTime": "",
            "loginId": this.loginId,
            "opeNo": this.opeNo,
            "originCustId": "",
            "originalContactid": "",
            "releaseCause": "",
            "sessionType": this.sessionType,
            "sessionId": data.properties.uniqueId,
            "ucid": ucid,
            "bnknbr": '6440',
            "repeatedCalls": '0',
            "ivrOperationTrajectory": operatetraject,
        };
        window.insertCallHistory(param);
    };

    /**
       * 更新通话历史
     *  map.set('IDTYPE',window.sessionCustData.keyType);
     map.set('IDNO',window.sessionCustData.custCertNo);
     map.set('CARD',window.sessionCustData.cradNo);
       */
    this.updateCallHistory = function (type, data) {
        var auth = '';
        var ucid = '';
        if (this.direction === 'in') {
            ucid = this.sessionData.userData.uui;
        } else {
            ucid = data.properties.uniqueId;
        }
        try {
            auth = this.sessionData.ivrData.data.AUTH;
        } catch (e) {
        }
        var param = {
            "sessionId": data.properties.uniqueId,
            "ucid": ucid,
            "ctiNo": this.agentId,
            "loginId": this.loginId,
            "releaseCause": "",
            "reserv1": type,
            "msyFlag": this.msyFlag,
            "acctNo": window.sessionCustData.cradNo,
            "custHometel": window.sessionCustData.custHomeTel,
            "custName": window.sessionCustData.custName,
            "enname": window.sessionCustData.enName,
            "custNo": window.sessionCustData.custNo,
            "custPhone": window.sessionCustData.custPhone,
            "idNo": window.sessionCustData.custCertNo,
            "idType": window.sessionCustData.keyType,
            "auth": auth,
            "sessionType": this.sessionType,
            // "ivrOperationTrajectory":this.sessionData.ivrData.data.OPERATETRAJECT
        };
        window.updateCallHistory(param);
    };

    /**
     * 更新坐席状态
     */
    this.updateAgentStatus = function (statusCode, statusName) {
        var param = {
            "agentId": this.agentId,
            "extNo": this.extNo,
            "loginId": this.loginId,
            "loginName": this.agentName,
            "optNo": this.opeNo,
            "statusCode": statusCode,
            "statusName": statusName,
        };
        window.updateAgentStatus(param);
    };
    /**
     * 记录日志席状态
     */
    this.updateAgentStatusLog = function (statusCode, statusName, flag) {
        var param = {
            "agentId": this.agentId,
            "extNo": this.extNo,
            "flag": flag,
            "loginId": this.loginId,
            "loginName": this.agentName,
            "optNo": this.opeNo,
            "statusCode": statusCode,
            "statusName": statusName,
        };
        window.updateAgentStatusLog(param);
    };

    /***
     * 会议转接IVR状态控制
     * @param flag
     */
    this.conferenceToIvrStauts = function (flag) {
        if (flag === 'conferenceAgentOk') {
            //完成会议
            this.conferenceAgentOkBtnClick();
        } else if (flag === 'hold') {
            //保持
            this.callHold();
        } else if (flag === 'completeCance') {
            //取回
            this.completeCancelBtnClick();
        } else if (flag === 'retrieve') {
            //恢复
            this.callRetrieve();
        } else {
            console.log("我什么也不是");
        }
    }

    /**
       * 自助语音返回处理
       */
    this.ivrReturnToAgent = function (key) {
        let ivrData = this.getUserAllData(this.uui);
        console.log("ivrReturnToAgentData:::", ivrData);
        if (ivrData.data.MSGID !== '101') {
            if (ivrData.data.RESPCODE) {
                if (ivrData.data.RESPDESC) {
                    this.showErrorInfo('提示', ivrData.data.RESPDESC, 'error');
                } else {
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.RESPCODE + ":" + window.getResponseDesc(ivrData.data.RESPCODE), 'error');
                }
            } else {
                if(ivrData.data.MSGID === '102'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":用户挂机" , 'error');
                }else if(ivrData.data.MSGID === '103'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":系统错误" , 'error');
                }else if(ivrData.data.MSGID === '104'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":交易失败" , 'error');
                }else if(ivrData.data.MSGID === '105'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":返回上级菜单" , 'error');
                }else if(ivrData.data.MSGID === '106'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":返回主菜单" , 'error');
                }else if(ivrData.data.MSGID === '107'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":用户未核身" , 'error');
                }else if(ivrData.data.MSGID === '108'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":按键超时" , 'error');
                }else if(ivrData.data.MSGID === '109'){
                    this.showErrorInfo('提示', 'IVR处理失败' + ivrData.data.MSGID + ":输入次数过多" , 'error');
                }

            }
        } else {
            if (ivrData.data.MENUID === 'CONF901') {
                this.showErrorInfo('提示', '查询密码设置成功', 'success');
                this.sessionData.ivrData.data.AUTH = '1';
                window.updatePinFlag('cxmm', 1);
            } else if (ivrData.data.MENUID === 'CONF902') {
                this.showErrorInfo('提示', '查询密码重置成功', 'success');
                this.sessionData.ivrData.data.AUTH = '1';
            } else if (ivrData.data.MENUID === 'CONF903') {
                this.showErrorInfo('提示', '查询密码修改成功', 'success');
                this.sessionData.ivrData.data.AUTH = '1';
            } else if (ivrData.data.MENUID === 'CONF904') {
                this.showErrorInfo('提示', '交易密码设置成功', 'success');
                this.sessionData.ivrData.data.PEGTD = '1';
                window.updatePinFlag('jymm', 1);
            } else if (ivrData.data.MENUID === 'CONF905') {
                this.showErrorInfo('提示', '交易密码重置成功', 'success');
            } else if (ivrData.data.MENUID === 'CONF906') {
                this.showErrorInfo('提示', '交易密码修改成功', 'success');
            } else if (ivrData.data.MENUID === 'CONF907') {//验证查询密码
                this.showErrorInfo('提示', '查询密码验证成功', 'success');
                this.sessionData.ivrData.data.AUTH = '1';
            } else if (ivrData.data.MENUID === 'CONF909') {//验证交易密码
                this.showErrorInfo('提示', '交易密码验证成功', 'success');
                this.sessionData.ivrData.data.PEGTD = '1';
            } else {
                this.showErrorInfo('提示', '未知IVR节点' + ivrData.data.MSGID + ":" + ivrData.data.RESPDESC, 'error');
            }

        }
    };

}
